package com.link2room.jetfire.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by sss on 2016/9/20.
 */
@Entity
@Table(name = "gc_order_coupon")
@DynamicInsert
public class GcOrderCoupon extends BaseEntity{
    public enum GcOrderCoupon_{
        l2RNo,couponType,couponNo,presentValue
    }
    /**
     * 联房订单号
     */
    private String l2RNo;
    /**
     * 券类型
     */
    private String couponType;
    /**
     * 券代码
     */
    private String couponCode;
    /**
     * 券号
     */
    private String couponNo;
    /**
     * 面值
     */
    private String presentValue;
    /**
     * 券代码
     */
    private String couponName;

    @Basic
    @Column(name = "l2r_no", nullable = true, length = 32)
    public String getL2RNo() {
        return l2RNo;
    }

    public void setL2RNo(String l2RNo) {
        this.l2RNo = l2RNo;
    }

    @Basic
    @Column(name = "coupon_type", nullable = false, length = 16)
    public String getCouponType() {
        return couponType;
    }

    public void setCouponType(String couponType) {
        this.couponType = couponType;
    }
    @Basic
    @Column(name = "coupon_code", nullable = false, length = 16)
    public String getCouponCode() {
        return couponCode;
    }

    public void setCouponCode(String couponCode) {
        this.couponCode = couponCode;
    }

    @Basic
    @Column(name = "coupon_no", nullable = true, length = 32)
    public String getCouponNo() {
        return couponNo;
    }

    public void setCouponNo(String couponNo) {
        this.couponNo = couponNo;
    }

    @Basic
    @Column(name = "present_value", nullable = true, length = 32)
    public String getPresentValue() {
        return presentValue;
    }

    public void setPresentValue(String presentValue) {
        this.presentValue = presentValue;
    }

    @Basic
    @Column(name = "coupon_name", nullable = true, length = 32)
    public String getCouponName() {
        return couponName;
    }

    public void setCouponName(String couponName) {
        this.couponName = couponName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GcOrderCoupon that = (GcOrderCoupon) o;

        if (l2RNo != null ? !l2RNo.equals(that.l2RNo) : that.l2RNo != null) return false;
        if (couponType != null ? !couponType.equals(that.couponType) : that.couponType != null) return false;
        if (couponNo != null ? !couponNo.equals(that.couponNo) : that.couponNo != null) return false;
        if (presentValue != null ? !presentValue.equals(that.presentValue) : that.presentValue != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = l2RNo != null ? l2RNo.hashCode() : 0;
        result = 31 * result + (couponType != null ? couponType.hashCode() : 0);
        result = 31 * result + (couponNo != null ? couponNo.hashCode() : 0);
        result = 31 * result + (presentValue != null ? presentValue.hashCode() : 0);
        return result;
    }
}
